package org.jin.samples.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;


@Entity
@Table(name="exam_user")
public class ExamUser implements Serializable{

	private static final long serialVersionUID = -7060069715681475840L;
	
	@Id
	@Column(name="user_id", nullable=false)
	private String userId;
	
	@Column(name = "user_name", length=40, nullable=false)
	private String userName;
	
	@Column(name = "password", length=40, nullable=false)
	private String password;
	
	@Column(name = "tel", length=40, nullable=false)
	private String tel;
	
	@Column(name = "email", length=40, nullable=false)
	private String email;
	
	@Column(name = "address", length=40, nullable=false)
	private String address;
	
	@Column(name = "birthday", length=40, nullable=false)
	private String birthday;
	
	@Column(name = "gender", length=40, nullable=false)
	private int gender;
	
	@Column(name = "last_lock_time", length=40, nullable=false)
	private Date lastLockTime;
	
	@Column(name = "login_fail_count", length=40, nullable=false)
	private Integer loginFailCount;
	
	@ManyToMany(mappedBy="user")
	private Set<ExamRole> examRole;
	
	@OneToMany(mappedBy = "userId")
	private Set<ExamScore> examScore;
	
	public Set<ExamRole> getExamRole() {
		return examRole;
	}
	public void setExamRole(Set<ExamRole> examRole) {
		this.examRole = examRole;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getTel() {
		return tel;
	}
	public void setTel(String tel) {
		this.tel = tel;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getBirthday() {
		return birthday;
	}
	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}
	public int getGender() {
		return gender;
	}
	public void setGender(int gender) {
		this.gender = gender;
	}
	public Date getLastLockTime() {
		return lastLockTime;
	}
	public void setLastLockTime(Date date) {
		this.lastLockTime = date;
	}
	public Integer getLoginFailCount() {
		return loginFailCount;
	}
	public void setLoginFailCount(Integer loginFailCount) {
		this.loginFailCount = loginFailCount;
	}
	public ExamUser() {
		super();
	}
	
	
	
}
